#include "files/file_manager.h"
#include "settings/command_line.h"
#include "settings/settings.h"
#include "settings/settings_parser.h"

namespace Tvimeg
{
	const std::string SETTINGS_COMMAND("settings");

	Settings::Settings(void)
	{
	}

	Settings::~Settings(void)
	{
	}

	bool Settings::Initialise(void)
	{
		const std::string& settingsFile = CommandLine::GetInstance().GetCommand(SETTINGS_COMMAND);
		SettingsParser parser(*this);
		return parser.Parse(FileManager::GetInstance().GetWorkingDirectory().GetRelativeFile(settingsFile));
	}

	void Settings::AddMovieDirectory(const Directory& directory)
	{
		movies.push_back(directory);
	}

	void Settings::AddTVSeriesDirectory(const Directory& directory)
	{
		tvSeries.push_back(directory);
	}

	void Settings::AddFileType(const std::string& fileType)
	{
		fileTypes.push_back(fileType);
	}

	void Settings::AddMultiPart(const std::string& multiPart)
	{
		multiParts.push_back(multiPart);
	}

	void Settings::SetDatabaseFile(const File& file)
	{
		databaseFile = file;
	}
}
